all : test LDAhid.o profile_test

# How we create LDAhid.o
LDAhid.o : LDAhid.c LDAhid.h
# The following line works for Debian
	gcc -o LDAhid.o -c LDAhid.c -fPIC -I/usr/include/libusb-1.0 -lpthread -lusb-1.0 -lm
	gcc -shared -o libLDAhid.so LDAhid.o -fPIC -I/usr/include/libusb-1.0 -lpthread -lusb-1.0 -lm

# The final output is one or more linked object files
test : test.c LDAhid.o LDAhid.h
	gcc -o test test.c LDAhid.o -I/usr/include/libusb-1.0 -lpthread -lusb-1.0 -lm

# The final output is one or more linked object files
profile_test : profile_test.c LDAhid.o LDAhid.h
	gcc -o profile_test profile_test.c LDAhid.o -I/usr/include/libusb-1.0 -lpthread -lusb-1.0 -lm

clean :
	rm -f LDAhid.o
	rm -f test
	rm -f profile_test
	rm -f libLDAhid.so

